package com.jiangzhuolin.admin.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

/**
 * 自定义的密码加密方式，此处使用 Spring Security 已经实现的 BCrytPasswordEncoder。也可以自己实现 implements PasswordEncoder
 */
@Component
public class MyPasswordEncoder extends BCryptPasswordEncoder {

    public static void main(String[] args) {
        MyPasswordEncoder myPasswordEncoder = new MyPasswordEncoder();
        String string = myPasswordEncoder.encode("123456");
        System.out.println(string);
    }

}
